<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title> 车辆管理-添加保险记录</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-insurance-edit">
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车牌号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  readonly="true" placeholder="车牌号" value = "${(insurance.carid)!''}" id="carid" name="carid">
		</div>
	</div>
		
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>保险公司：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  value="${(insurance.company)!''}" placeholder="保险公司" id="company" name="company">
		</div>
	</div>

	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出险电话：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text"  value="${(insurance.companyphone)!''}" placeholder="出险电话" id="companyphone" name="companyphone">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>保险编号</label>
		<div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(insurance.code)!''}" placeholder="保险编号" id="code" name="code">
		</div>
	</div>
		
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>保险内容</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(insurance.content)!''}" placeholder="保险内容" id="content" name="content">
		</div>
	</div>
		
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>保险费用</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(insurance.money?c)!''}" placeholder="保险费用" id="money" name="money">
		</div>
	</div>			
		
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>生效日期</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" value="${(insurance.validdate)!''}" placeholder="生效日期" id="validdate" name="validdate">
		</div>																	
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>失效日期</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',endDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" value="${(insurance.invaliddate)!''}" placeholder="失效日期" id="invaliddate" name="invaliddate">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>经办人</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off"  placeholder="经办人" value="${(insurance.contactman)!''}" id="contactman" name="contactman">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>经办手机</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off"  placeholder="经办手机" value="${(insurance.contactmobile)!''}" id="contactmobile" name="contactmobile">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">备注：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<textarea id="remark" name="remark" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" dragonfly="true" value="${(insurance.remark)!''}" onKeyUp="textarealength(this,100)"></textarea>
			<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
		</div>
	</div>
	
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="$('#form-insurance-edit').submit()"/>
		</div>
	</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
$("#finish").change(function(){
        var finish =document.getElementById("finish");        
        var finishs=document.getElementById("div");         
        if(finish.checked==true){
            finishs.style.display="block";            
            }else{
            finishs.style.display="none";
         }
     });
$("#form-insurance-edit").validate({
		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){			
	   		$.ajax({
	            type: 'put', 
				contentType:"application/json", 
	            url: '/insurance/${insurance.recordid}',
	            data:JSON.stringify({						
		                'carid': $("#carid").val(),
		                'company': $("#company").val(),
		                'companyphone': $("#companyphone").val(),
		                'code': $("#code").val(),
		                'content': $("#content").val(),
		                'money': $("#money").val(),							               
						'contactman':$('#contactman').val() ,
						'contactmobile': $("#contactmobile").val(),
						'remark': $("#remark").val(),
						'validdate':$("#validdate").val(),	
						'invaliddate':$("#invaliddate").val()					 												
						}),	
	           success:function(data){ 
					
	 				console.log('提交成功！');	 			
	 				var index = parent.layer.getFrameIndex(window.name);
					parent.$("#searchInsurance").click();
					parent.layer.close(index);
	            },
	
	        });


			
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
